package com.jjc.android.util

import android.text.NoCopySpan
import android.text.TextPaint
import android.text.style.ClickableSpan
import android.view.View

open class NoRefCopySpan(private val showUnderlineText:Boolean = false, private val click:()->Unit) : ClickableSpan() {

    override fun onClick(widget: View) {
        click.invoke()
    }

    override fun updateDrawState(ds: TextPaint) {
        super.updateDrawState(ds)
        ds.isUnderlineText = showUnderlineText

    }
}